from model import Model

class Advertisement(Model):
    
    def __init__(self, _dict):
        Model.__init__(self, _dict)
        
        self.prefer_contact = _dict['prefer_contact']
        self.email = _dict['email']
        self.phone = _dict['phone']
        #self.ad_by = ad_by
        #self.term = term
        self.type = _type = _dict['type'] # 0 rent, 1 sell
        self.created = _dict['created']
        
        # Associate fields
        self.category = _dict['category']
        self.item = _dict['item']
        self.user = _dict['user']
        

if __name__ == '__main__':
    # create table
    #db.drop_all()
    #db.create_all()
    pass